package db4oClass.server;

import com.db4o.ObjectContainer;
import com.db4o.cs.Db4oClientServer;
import com.db4o.messaging.MessageSender;

import db4oClass.ServerInfo;

public class StopServer implements ServerInfo {
	public static void main(String[] args) {
		ObjectContainer objectContainer = null;
		try {
			objectContainer = Db4oClientServer.openClient(Db4oClientServer.newClientConfiguration(),
														  HOST, 
														  PORT,
														  USER, 
														  PASS);
			
		}catch(Exception e) {
			e.printStackTrace();
		}
		
		if(objectContainer != null) {
			MessageSender messageSender = objectContainer.ext().configure().clientServer().getMessageSender();
			
			messageSender.send(new StopServer());
			
			objectContainer.close();
		}
	}
}
